package com.stagechatserver.chatserver.controller;

import com.stagechatserver.chatserver.service.ChatService;
import com.stagecommon.common.pojo.Chat;
import com.stagecommon.common.pojo.RespBean;
import com.stagecommon.common.vo.ChatVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: yxl
 * @since: 2022-03-19
 **/
@Slf4j
@RestController
@RequestMapping("/session")
public class ChatController {
    @Autowired
    private ChatService chatService;

    @PostMapping("/getSession")
    public RespBean<List<ChatVo>> getSession(@RequestBody Chat chat){
        return chatService.getSession(chat.getSender(),chat.getReceiver());
    }
    
//    @PostMapping("/sendMessage")
//    public RespBean sendMessage(@RequestBody Chat chat){
//        
//    }
}
